# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=netbios-share-scanner
pkgver=1.0
pkgrel=4
groups=('blackarch' 'blackarch-scanner')
pkgdesc='This tool could be used to check windows workstations and servers if they have accessible shared resources.'
arch=('any')
url='http://www.secpoint.com/netbios-share-scanner.html'
license=('BSD')
depends=('python2')
source=("http://www.secpoint.com/freetools/$pkgname-$pkgver.zip")
sha512sums=('7ac4c309c348707015b6e0e77bb1fa9595762b9e0b1ea5dd462a8d9810e6eed5dea8131690e236c91ea399a72ae2aa8a267fd848809c97acda04b7d6f6878568')

package() {
  cd "nb${pkgver/./}"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.txt

  rm README.txt

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

